{% load i18n %}
{% load permissions_tags %}
<!--by lxy--> 
<!--{#{% ifhasperm_dep view 市场部 %}#}-->
{% if user.is_admin %}
{% if perms.manufactureplan.view_order %}
  <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>业务</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu">
    {% if perms.manufactureplan.view_order %}
      <li><a tabindex="-1" href="{% url admin:manufactureplan_order_changelist %}?_p_status__exact=1">{% trans 'orders' %}</a></li>
    {% endif %}
    {% if perms.manufactureplan.view_manufactureplan %}
      <li><a tabindex="-1" href="{% url admin:manufactureplan_manufactureplan_changelist %}?_p_status__exact=1">{% trans 'manufacture_plan' %}</a></li>
    {% endif %}
    {% if perms.manufactureplan.view_manufactureitemgroup %}
      <li><a tabindex="-1" href="{% url admin:manufactureplan_manufactureitemgroup_changelist %}">{% trans 'productionline' %}</a></li>
    {% endif %}
    {% if perms.manufactureplan.view_manufactureitem %}
      <li><a tabindex="-1" href="{% url admin:manufactureplan_manufactureitem_changelist %}">工件</a></li>
    {% endif %}
    </ul> 
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

<!--{#{% ifhasperm_dep view 总经办 %}#}-->
{% if perms.productcatalog.view_product or perms.companydepartment.view_department %}
   <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'basic information' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu"> 
    {% if perms.productcatalog.view_product %}
      <li><a tabindex="-1" href="{% url admin:productcatalog_product_changelist %}?_p_type__exact=1&kind_of_category=product&is_kind=true">{% trans 'catalog' %}</a></li>
    {% endif %}
    {% if perms.companydepartment.view_department %}
      <li><a tabindex="-1" href="{% url admin:companydepartment_department_changelist %}">{% trans 'department' %}</a></li>
    {% endif %}
    {% if perms.person.view_employee %}
      <li><a tabindex="-1" href="{% url admin:person_employee_changelist %}">{% trans 'employee' %}</a></li>
    {% endif %}
    {% if perms.customer.view_customer %}
      <li><a tabindex="-1" href="{% url admin:customer_customer_changelist %}">{% trans 'customer' %}</a></li>
    {% endif %}
    {% if perms.auth.view_user %}
      <li><a tabindex="-1" href="{% url admin:auth_user_changelist %}?_p_is_superuser__exact=0&_p_is_active__exact=1">{% trans 'user' %}</a></li>
    {% endif %}
    {% if request.user.is_superuser %}
      <li><a tabindex="-1" href="{% url admin:actstream_action_changelist %}">{% trans 'actstream action log' %}</a></li>
    {% endif %}
    </ul>
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

<!--{#{% ifhasperm_dep view 技术部 %}#}-->
{% if perms.technologies.view_technology %}
 <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'technology' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu"> 
    {% if perms.technologies.view_technology %}
      <li><a tabindex="-1" href="{% url admin:technologies_technology_changelist %}?_p_status__exact=1">{% trans 'technology' %}</a></li>
    {% endif %}
    {% if perms.technologies.view_operationgroup %}
      <li><a tabindex="-1" href="{% url admin:technologies_operationgroup_changelist %}">{% trans 'operation group' %}</a></li>
    {% endif %}
    {% if perms.technologies.view_operation %}
      <li><a tabindex="-1" href="{% url admin:technologies_operation_changelist %}">{% trans 'operation' %}</a></li>
    {% endif %}
    {% if perms.technologies.view_technology %}
      <li><a tabindex="-1" href="{% url technologies_list %}">{% trans 'technologies list' %}</a></li>
    {% endif %}
    </ul>
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

<!--{#{% ifhasperm_dep view 生产部 %}#}-->
{% if perms.manufactureplan.view_productionline %}
  <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'manufacture' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu">
      <li><a tabindex="-1" href="{% url operation_working_device_items_list %}">{% trans 'working dashboard' %}</a></li>
      <!--{#{% ifhasperm_dep manage 生产部 %}#}-->
      {% if perms.manufactureplan.change_productionline %}
        <li><a tabindex="-1" href="{% url productionlines_list %}">{% trans 'productionlines list' %}</a></li>
      {% endif %}
      {% if perms.manufactureplan.monitor_productionLine %}
        <li class="divider"></li>
        <li class="dropdown-header" style="font-size:14px;">监控</li>
        <li><a tabindex="-1" href="{% url productionlines_monitoring %}">生产任务监控</a></li>
      {% endif %}
      <!--{#{% endifhasperm_dep %}#}-->
    </ul>  
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

<!--{#{% ifhasperm_dep view 质量部 %}#}-->
{% if perms.manufactureplan.quality_dispaly %}
  <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'QC' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu">
      <li><a tabindex="-1" href="{% url excessive_qa_records_list %}">{% trans 'excessive_qa_records_list' %}</a></li>
      <li><a tabindex="-1" href="{% url wait_excessive_qa_records_list %}">{% trans '待处理' %}</a></li>
      <li><a tabindex="-1" href="{% url pass_excessive_qa_records_list %}">{% trans '检验通过单（检验员）' %}</a></li>
      <li><a tabindex="-1" href="{% url fail_excessive_qa_records_list %}">{% trans '检验不通过单（检验员）' %}</a></li>
    </ul>
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

<!--{#{% ifhasperm_dep view 仓库 %}#}-->
{% if perms.warehouse.view_itementry %}
 <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'warehouse' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu"> 

      <li><a tabindex="-1" href="{% url admin:warehouse_itementry_changelist %}?_p_journal__id__exact=1&_p_item__content_type__model__exact=product&_p_location__type__exact=1">{% trans 'product' %}信息</a></li>

      <li><a tabindex="-1" href="{% url admin:warehouse_deviceentry_changelist %}?_p_journal__id__exact=1&_p_item__content_type__model__exact=device&_p_location__type__exact=1">{% trans 'device' %}信息</a></li>

      <li><a tabindex="-1" href="{% url admin:warehouse_deviceentry_changelist %}?_p_journal__id__exact=1&_p_item__content_type__model__exact=knife&_p_location__type__exact=1">{% trans 'knife' %}信息</a></li>

      <li><a tabindex="-1" href="{% url admin:warehouse_deviceentry_changelist %}?_p_journal__id__exact=1&_p_item__content_type__model__exact=tool&_p_location__type__exact=1">{% trans 'Tool' %}信息</a></li>


      <li><a tabindex="-1" href="{% url admin:warehouse_itementry_changelist %}?_p_journal__id__exact=1&_p_item__content_type__model__exact=material&_p_location__type__exact=1">{% trans 'Material' %}信息</a></li>

      {% if perms.warehouse.add_transportlist %}
        <li class="divider"></li>
        <li><a tabindex="-1" href="{% url applications_list %}">{% trans 'applications_list' %}</a></li>
      {% endif %}
        <li><a tabindex="-1" href="{% url admin:maintenance_maintenance_changelist %}">{% trans 'Maintenance' %}记录</a></li>
      <li><a tabindex="-1" href="{% url admin:productcatalog_attribute_changelist %}">属性列表</a></li>
      
      <li><a tabindex="-1" href="{% url admin:warehouse_location_changelist %}">库位设置</a></li>
      
      <li><a tabindex="-1" href="{% url admin:warehouse_electricitycharge_changelist %}">{% trans 'electricity charge' %}</a></li>

    </ul>
  </li>
{% endif %}
<!--{#{% endifhasperm_dep %}#}-->

{% if perms.auth.delete_user %}
  <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'messages' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu">
      <li><a tabindex="-1" href="/messages/">{% trans 'messages' %}</a></li>
    </ul>
  </li>
{% endif %}
 <!--by lxy end-->
{% if perms.auth.view_user %}
  <li class="dropdown">
    <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
    <strong>{% trans 'report' %}</strong> <span class="caret"></span></a>
    <ul id="g-account-menu" class="dropdown-menu" role="menu">
      <li><a tabindex="-1" href="{% url ext_manufactureitem_working_time %}">{% trans 'report center' %}</a></li>
    </ul>
  </li>
{% endif %}

{% endif %}